/*
 * @Author: Li Zengkun
 * @Date: 2022-09-26 16:58:51
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-09-28 20:22:37
 * @Description: 
 */
import { createRouter, createWebHashHistory } from "vue-router"
import layout from '@/components/Layout.vue'
const routes = [{
        path: '/login',
        alias: '/',
        name: "Login",
        component: () =>
            import ("@/views/Login.vue")
    },
    {
        path: '/register',
        name: "Register",
        component: () =>
            import ("@/views/Register.vue")
    },
    {
        path: '/goods',
        component: layout,
        children: [{
                path: 'list',
                name: 'GoodsList',
                component: () =>
                    import ("@/views/Goods/list.vue")
            },
            {
                path: 'release',
                name: 'GoodsRelease',
                component: () =>
                    import ("@/views/Goods/Release.vue")
            },
            {
                path: 'category',
                name: 'GoodsCategory',
                component: () =>
                    import ("@/views/Goods/Category.vue")
            },
        ]
    },
    {
        path: '/order',
        component: layout,
        children: [{
            path: 'list',
            name: 'orderList',
            component: () =>
                import ("@/views/Order/List.vue")
        }, ]
    },
    {
        path: '/user',
        component: layout,
        children: [{
                path: 'info',
                name: 'userInfo',
                component: () =>
                    import ("@/views/User/Info.vue")
            },
            {
                path: 'list',
                name: 'userList',
                component: () =>
                    import ("@/views/User/List.vue")
            },
        ]
    },
    {
        path: '/auth',
        component: layout,
        children: [{
                path: 'role',
                name: 'authRole',
                component: () =>
                    import ("@/views/Auth/Role.vue")
            },
            {
                path: 'menu',
                name: 'authMenu',
                component: () =>
                    import ("@/views/Auth/Menu.vue")
            },
        ]
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router